<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var s = 'http://localhost:63342/web3培训课堂代码/2%20JavaScript基础/9%20BOM/7history/pushState.html?_ijt=8hfeh1u120i463411okiqahpao';
    function mySubString(search,s){
        var pos = s.lastIndexOf('#');
        if (pos!=-1){
            s = s.slice(0,pos);
        }
        return s;
    }
//    console.log(mySubString("#",s));
    function mySubStringAfter(search,s){
        var pos = s.lastIndexOf('#');
        if (pos!=-1){
            s = s.slice(pos+1);
        } else {
            s = 0;
        }
        return s;
    }
    console.log(mySubStringAfter('#',s))
</script>
</body>
</html>